The invention generally relates to a process for modifying coded bit streams. More particularly, the invention is directed to a process for inserting a visual element into a moving pictures group-type 2 (xe2x80x9cMPEG 2xe2x80x9d) encoded video bit stream.
Traditionally, broadcast stations insert visual elements (e.g., logos, station identifications, video sequences, and the like) into video signals broadcast to the end viewer. Before the advent of compressed video stream transmission, the insertion of a logo into a broadcast was a relatively straight forward procedure of superimposing or substituting the logo image over a selected portion of a video frame. However, with the advent of compressed video stream transmission (e.g., MPEG-coded video streams) the insertion of logos into video broadcast has become complicated due to temporal dependencies in the coded video stream. In particular, each frame in the video stream no longer contains all the information necessary to reconstruct the video image. Rather, only a few frames (e.g., I frames) in the video stream contain all the information that is needed to re-construct a video image. Other xe2x80x9cpredictivexe2x80x9d frames (e.g., P frames and B frames) reference the portions of the complete frames (e.g., I frames) that are necessary for the reconstruction of the predictive frames, as discussed in further detail below.
One method of inserting a logo into an MPEG-coded video stream is to decode the video stream, insert the logo in the pixel domain, and re-encode the video stream. However, the process of decoding and re-encoding the entire video stream has several drawbacks. One drawback is that the decoding and re-encoding process results in a loss in image quality since errors are introduced into the video stream. These errors are due, in part, to the non-reversible nature of some of the coding techniques (e.g., quantization and inverse quantization). Another drawback is that decoding and re-encoding the entire video stream requires a significant amount of computation.
In addition to the drawbacks discussed above, there is an additional difficulty encountered when inserting a logo into an MPEG-encoded video stream. The insertion of the logo may affect the bit count of the video stream. In particular, the insertion of the logo may cause the bit count of the video stream to increase or decrease and this, in turn, may affect Video Buffer Verifier (VBV) compliance. More specifically, the input buffer of a decoder, under the MPEG standard, has a fixed buffer size and handles transitions between a constant channel bit rate, i.e., the rate at which the video is displayed, and a fluctuating MPEG coded bit rate, i.e., the rate at which the compressed video is passed. Preferably, data flows through the buffer so underflow and overflow conditions are avoided. However, altering the bit count of the MPEG-encoded video stream may cause underflow or overflow conditions to occur in the input buffer of a downstream decoder.
The present invention is directed to overcoming the drawbacks and difficulties discussed above.
Briefly stated, a transcoding method for inserting a visual element into an encoded bit stream with minimal decoding of the encoded bit stream is provided. The transcoding method includes the steps of receiving an encoded bit stream containing a picture, partially decoding a copy of the bit stream, determining if a segment of the picture in the bit stream is affected by the insertion of the visual element, re-encoding the segment if the segment is affected by the insertion of the visual element, and outputting the re-encoded bit stream. The encoded and re-encoded bit streams may be MPEG-encoded bit streams. The re-encoded bit stream may be output using a bit rate control process that randomly selects an initial processing point within the re-encoded bit stream, requantizes the re-encoded bit stream using a modified quantization table, and/or utilizes a slice-level stopping criteria for selectively starting or ending bit rate control.
In one advantageous embodiment of the invention, a transcoding method for inserting a visual element into an encoded bit stream representing a series of image frames is provided. The transcoding method includes receiving the encoded bit stream, partially decoding the encoded bit stream, inserting the visual element into the partially decoded bit stream, re-encoding the partially decoded bit stream after the visual element is inserted, and outputting the re-encoded bit stream.
In another advantageous embodiment of the invention, a transcoding method for inserting a visual element into an insertion region of an encoded bit stream representing a series of image frames is provided. The transcoding includes receiving a first encoded bit stream, decoding a copy of the first encoded bit stream to determine a position of a segment of an image frame, comparing the insertion region to the position of the segment to determine if the insertion of the visual element would affect the segment, re-encoding the segment if the insertion of the visual element affects the segment, and outputting a second encoded bit stream, the second encoded bit stream being a combination of the first encoded bit stream and the re-encoded segment.
In a further advantageous embodiment of the invention, a transcoding method for inserting a visual element into an insertion region of an encoded bit stream is provided. The transcoding method includes receiving a first encoded bit stream representing an image, decoding a copy of the first encoded bit stream to detect characteristics of respective segments of the image, comparing the characteristics of the segments to the insertion region to determine if the insertion of the visual element into the image would affect the segments, re-encoding the affected segments, and outputting a second encoded bit stream such that the second encoded bit stream contains the same number of bits as the first encoded bit stream, the second encoded bit stream being a combination of the first encoded bit stream and the re-encoded segments.